#ifndef ECARX_VHAL_LOG_H
#define ECARX_VHAL_LOG_H
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <android/log.h>
#include <string>
#include <thread>

namespace ecarx::vhal::core {

    class VHalLog{
    private:
        std::string mLogTag;
        VHalLog();
        void log(int logLevel, const char* tag, const char* format, va_list args);
    public:
        static thread_local std::string mFileName;
        static thread_local int mLine;
        static VHalLog& getInstance(const char* fileName="", int line=0);
        void d(const char *format, ...);
        void dTag(const char* tag, const char* format, ...);
        void w(const char* format, ...);
        void wTag(const char* tag, const char* format, ...);
        void e(const char* format, ...);
        void eTag(const char* tag, const char* format, ...);
    };
}// namespace ecarx::vhal_core

#define VHALOG ecarx::vhal::core::VHalLog::getInstance(__FILE_NAME__, __LINE__)

#endif